package com.ruoyi.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

public class CommonConstants {

     //0:无 1:PC 2:手机 3:小程序

    @Getter
    @AllArgsConstructor
    public enum TerminalEnum {
        UnKNOW(0, "未知"),
        PC(1, "PC端"),
        PHONE(2, "移动端"),
        APPLET(3, "小程序端"),
        ;
        private int value;
        private String desc;

        public static CommonConstants.TerminalEnum match(int value) {
            for (CommonConstants.TerminalEnum one : CommonConstants.TerminalEnum.values()) {
                if (one.getValue() == value) {
                    return one;
                }
            }
            return CommonConstants.TerminalEnum.UnKNOW;
        }
    }
}
